<template>
	<view class="Jy_update_page">
		<view class="Jy_update_container">
			<view class="Jy_update_input_box">
				<input type="text" :placeholder="placeholderVal" v-model="userData" v-if="key == 1">
				<textarea :placeholder="placeholderVal" v-model="userData" cols="30" rows="10" v-else></textarea>
			</view>
			<view class="save_button_box" @click="">
				<text>保存</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				key: '',
				userData: '',
				placeholderVal: ''
			};
		},
		onLoad(option) {
			this.getPageTitle(option.key)
			this.userData = option.data;
		},
		methods: {
			getPageTitle(key) {
				if (key == 1) {
					uni.setNavigationBarTitle({
						title: '昵称'
					})
					this.placeholderVal = '请输入昵称'
					this.key = key;
				} else {
					uni.setNavigationBarTitle({
						title: '简介'
					})
					this.placeholderVal = '请输入简介',
					this.key = key;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
@import 'updateInfo.scss';
</style>
